package com.zzy.chapter3.deprecated.state;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.UUID;

@Service
public class DeprecatedOrderService {

    @Autowired
    private DeprecatedOrderContext context;

    public DeprecatedOrder createOrder(String productId) {
        // 设计模式，随便先选一个id生成器
        String orderId = productId;
        return context.createOrder(orderId, productId);
    }

    public DeprecatedOrder payOrder(String orderId) {
        return context.payOrder(orderId);
    }

    public DeprecatedOrder receiveOrder(String orderId) {
        return context.receiveOrder(orderId);
    }

    public DeprecatedOrder sendOrder(String orderId) {
        return context.sendOrder(orderId);
    }
}
